﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IEx
{
    public class DownloadQueue : Queue<IEx.Model.Partials.Announcement>
    {
        public override bool Contains(IEx.Model.Partials.Announcement item)
        {
            // TODO to check whether item has already been in queue
            return true;
        }

        public override void Enqueue(IEx.Model.Partials.Announcement item)
        {
            lock (this)
            {
                itemsQueue.Insert(0, item);
                if (this.OnEnqueue != null)
                {
                    OnEnqueue.Invoke(this.QueueCount);
                }
            }
        }
    }
}
